package cs2114.antiFingerMines;

import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;

// -------------------------------------------------------------------------
/**
 *  Write a one-sentence summary of your class here.
 *  Follow it with additional details about its purpose, what abstraction
 *  it represents, and how to use it.
 *
 *  @author Blake Whaley
 *  @author Graham McLaughlin
 *  @author William Vuong
 *  @version Apr 9, 2012
 */
public class LocationTest
{

    /**
     * Location variable
     */
    Location loc;

    // ----------------------------------------------------------
    /**
     * This sets up the location to be tested
     */
    @Before
    public void setUp()
    {
        loc = new Location(12, 15);
    }

    /**
     * Tests the getXloc method
     */
    @Test
    public void testGetXloc()
    {
        assertEquals(12.0, loc.getXloc(), .0001);
    }

    /**
     * Tests the getYloc method
     */
    @Test
    public void testGetYloc()
    {
        assertEquals(15, loc.getYloc(), .0001);
    }

    /**
     * Tests the setXloc method
     */
    @Test
    public void testSetXloc()
    {
        loc.setXloc(29);
        assertEquals(29, loc.getXloc(), .00001);
    }

    /**
     * Tests the setYloc
     */
    @Test
    public void testSetYloc()
    {
        loc.setYloc(40);
        assertEquals(40, loc.getYloc(), .0001);
    }

}
